<?php

namespace Common\Model;

use Think\Model;

/**
 * Class PositionModel
 * @package Common\Model
 */
class PositionModel extends Model
{
    /**
     * @var \Model|string|Model
     */
    private $_db = '';

    /**
     * PositionModel constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->_db = M('Position');
    }

    /**
     * @return mixed
     */
    public function getNormalPositions()
    {
        $condition = ['status' => 1];

        $res = $this->_db
            ->where($condition)
            ->order('id desc')
            ->select();
        return $res;
    }

    /**
     * @return mixed
     */
    public function getPositions()
    {
        $res = $this->_db
            ->order('id desc')
            ->select();
        return $res;
    }
}